﻿
Imports centrosphere

Partial Public Class storageJobDistributor
    Protected Shared Function buff_merge_aggregate(ByVal targetJobs() As indexedJob, ByVal inputJob As ijob) As Boolean
        aggregate_internal.assert_input(targetJobs, inputJob)
        Dim sj As storageJob = Nothing
        sj = storageJob(inputJob)
        For i As Int64 = 0 To targetJobs.Length() - 1
            If targetJobs(i).finished() Then
                Dim tj As storageJob = Nothing
                tj = storageJob(targetJobs(i))
                If tj.result Then
                    sj.result = True
                    sj.buff += tj.buff
                End If
            End If
        Next

        Return True
    End Function
End Class
